package com.sihan.swvp.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

public class ReqeustPowerFilter implements Filter {

	@Autowired
    private PowerFilter powerFilter; /*注入下面的Spring容器中的bean，实现了具体的过滤器方法*/

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    	powerFilter.filter(request,response);  //具体的过滤规则写在下面一个类中
        chain.doFilter(request,response);
    }

    @Override
    public void destroy() {

    }

}
